-- GENERATED SPELL FOR [Ethereal Wind Trader] --


function spell0_32231(pUnit, Event) --@Arcane Barrage Volley,n/a--
pUnit:FullCastSpellOnTarget(59483,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32231', 564, 1)
end

function spell1_32231(pUnit, Event) --@Arcane Buffet,n/a--
pUnit:FullCastSpellOnTarget(59485,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32231', 20330, 1)
end

function spell2_32231(pUnit, Event) --@Summon Ethereal Sphere,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(54102,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_32231', 1, 1)
end

function spell3_32231(pUnit, Event) --@Summon Ethereal Sphere,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(54137,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_32231', 1, 1)
end

function spell4_32231(pUnit, Event) --@Summon Ethereal Sphere,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(54138,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_32231', 1, 1)
end

function spell5_32231(pUnit, Event) --@Summon Ethereal Sphere,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(61337,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_32231', 1, 1)
end

function spell6_32231(pUnit, Event) --@Summon Ethereal Sphere,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(61338,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_32231', 1, 1)
end

function spell7_32231(pUnit, Event) --@Summon Ethereal Sphere,Self--
pUnit:FullCastSpellOnTarget(61339,pUnit)
pUnit:RegisterEvent('Sorts_32231', 2500, 1)
end

function Sorts_32231(pUnit, Event)
local choix_sorts_32231 = math.random(0, 7)
if choix_sorts_32231 == 0 then
pUnit:RegisterEvent('spell0_32231', 1, 1)
end
if choix_sorts_32231 == 1 then
pUnit:RegisterEvent('spell1_32231', 1, 1)
end
if choix_sorts_32231 == 2 then
pUnit:RegisterEvent('spell2_32231', 1, 1)
end
if choix_sorts_32231 == 3 then
pUnit:RegisterEvent('spell3_32231', 1, 1)
end
if choix_sorts_32231 == 4 then
pUnit:RegisterEvent('spell4_32231', 1, 1)
end
if choix_sorts_32231 == 5 then
pUnit:RegisterEvent('spell5_32231', 1, 1)
end
if choix_sorts_32231 == 6 then
pUnit:RegisterEvent('spell6_32231', 1, 1)
end
if choix_sorts_32231 == 7 then
pUnit:RegisterEvent('spell7_32231', 1, 1)
end
end

function mob32231_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_32231', math.random(1500, 3000), 1)
end

function mob32231_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32231_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32231_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(32231, 1, 'mob32231_Action')
RegisterUnitEvent(32231, 2, 'mob32231_Leave')
RegisterUnitEvent(32231, 3, 'mob32231_Kill')
RegisterUnitEvent(32231, 4, 'mob32231_Die')
